java
html
css
c
xml
python
database
linux
android
ruby-on-rails
regex
eclipse
silverlight
json
cocoa
apache
mvc
api
postgresql
dom
has_one is for one-to-one relationships. That isn't what you want in this case.
has_one
If you were using mongoid, this is one design that could work for you. In it, there is a Collage class which embeds many slides.
class Collage include Mongoid::Document embeds_many :slides end class Slide include Mongoid::Document embedded_in :collage belongs_to :works end class Work include Mongoid::Document has_many :Slides field :image_url, type: String end
If you don't need the helper methods on the classes just create arrays and embedded documents yourself and manipulate them using the Ruby driver as needed. Essentially these class definitions would create the following collage documents:
Collage:
{ "slides": [ { "works": [ work_id, work_id , ....] }, { "works": [ work_id, work_id , ....] } ] }